using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Data.SqlClient;

/// <summary>
/// Summary description for CardTypeDAO
/// </summary>
public class CardTypeDAO:DBAccess
{
    string SQL_GET_ALL = "select * from dbo.card_types";
    string message = "";
	public CardTypeDAO()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public IList<CardType> GetAll()
    {
        IList<CardType> list = new List<CardType>();
        SqlCommand command = new SqlCommand(SQL_GET_ALL,conn);
        if (Connect())
        {
            SqlDataReader dr=command.ExecuteReader();
            while (dr.Read())
            {
                CardType type = new CardType();
                type.CardTypeID = dr.GetInt32(0);
                type.TypeName = dr.GetString(1);
                list.Add(type);
            }
            Disconnect();
        }
        return list;
    }
}
